11. Exercise: Query All Guests

Query All Guests

During this exercise, you'll run a select query on the SQLite database created for the waitlist app and update the list to show the number of rows based on the result of the query.

Exercise Code

Exercise: T07.03-Exercise-GetAllTheData

We encourage you to go try out what we just did yourself:

Check all the steps below once you're done

SOLUTION:
  • Create getAllGuests method that returns a cursor
  • Call it in onCreate and pass the cursor count to the adapter
  • Update the adapter to reflect the new count in the list